﻿namespace CV.Web
{
    using log4net;
    using log4net.Config;
    using System;
    using System.Web;
    using System.Web.Http;
    using System.Web.Mvc;
    using System.Web.Routing;

    public class Global : HttpApplication
    {
        private static readonly ILog logger = LogManager.GetLogger(typeof(Global));

        void Application_Start(object sender, EventArgs e)
        {
            XmlConfigurator.Configure();
            // Code that runs on application startup
            AreaRegistration.RegisterAllAreas();
            GlobalConfiguration.Configure(WebApiConfig.Register);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
        }

        void Application_Error(object sender, EventArgs e)
        {
            logger.Error("Erreur : ", Server.GetLastError());
#if !DEBUG
            Server.ClearError();
#endif
        }
    }
}
